using System;
using System.Collections.Generic;
using Library;
using Library.Util;
using NHibernate;

namespace Library.Persistence.Cloud.Dao
{
	public class CloudFirmaUnvanDao : BaseEntity
	{
		private readonly string fromHql = " from CloudFirmaUnvan as t ";
		public void Insert(CloudFirmaUnvan dto)
		{
			BasePersistence.Insert(dto);
		}

		public void Update(CloudFirmaUnvan dto)
		{
			BasePersistence.Update(dto);
		}

		public void Delete(CloudFirmaUnvan dto)
		{
			BasePersistence.Delete(dto);
		}

		public void Delete(int firmaUnvanId)
		{
			CloudFirmaUnvan dto = new CloudFirmaUnvan();
			dto.FirmaUnvanId = firmaUnvanId;
			Delete(dto);
		}

		public CloudFirmaUnvan Get(int firmaUnvanId, LockMode lockMode)
		{
			return Get<CloudFirmaUnvan>(firmaUnvanId, lockMode);
		}

		public List<CloudFirmaUnvan> FindAll()
		{
			return Find<CloudFirmaUnvan>(fromHql, LockMode.Read);
		}

		public List<CloudFirmaUnvan> FindAll(string orderStatement)
		{
			return Find<CloudFirmaUnvan>(fromHql + " ORDER BY " + orderStatement, LockMode.Read);
		}

	}
}
